<template>
  <page-body>
    <view class="page">
      <view class="flex benben-position-layout flex flex-wrap align-center customers_flex_0"
        :style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
        <view class='flex flex-wrap align-center justify-between flex-sub customers_fd0_0'>
          <view class='flex flex-wrap align-center customers_fd0_0_c0'>
            <!-- <text class='fu-iconfont2  customers_fd0_0_c0_c0'>&#xE794;</text> -->
          </view>
          <view class='flex flex-wrap align-stretch justify-center'>
            <text class='customers_fd0_0_c1_c0'>客户列表</text>
          </view>
          <view class='flex flex-wrap align-center justify-end customers_fd0_0_c0'>
          </view>
        </view>

      </view>
      <view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
      <!---flex布局flex布局开始-->
      <view class="flex flex-wrap align-center justify-between benben-flex-layout customers_flex_1">
        <view class='flex flex-wrap align-center customers_fd1_0'>
          <image class='customers_fd1_0_c0' mode="aspectFit" :src='STATIC_URL+"150.png"'></image>
          <benben-input class="input-box" type="text" :placeholder="`输入客户姓名/联系电话`" confirm-type="done" :maxlength="15"
            :adjust-position='true' placeholder-style="color:#999;font-size:26rpx" v-model="keywords"
            @confirm="getListFunc" />
        </view>
      </view>

      <!---flex布局flex布局结束-->
      <!---flex布局flex布局开始-->
      <view class="flex benben-flex-layout flex-wrap align-center customers_flex_2">

        <view class='flex  customers_fd2_0'>

        </view>

        <text class='customers_fd2_1'>客户数量</text>
        <text class='customers_fd2_2'>{{total}}</text>
      </view>

      <!---flex布局flex布局结束-->
      <!---flex布局flex布局开始-->
      <template v-for='(item,flex3) in dataList'>
        <view class="flex flex-direction align-stretch benben-flex-layout customers_flex_3" :key='flex3'
          @tap.stop="handleJumpDiy" data-type="navigateTo" :data-url="`/pages/grzx/custr/custr?aid=${item.aid}`">
          <view class='flex flex-wrap align-center justify-between customers_fd3_0'>
            <image class='customers_fd3_0_c0' mode="aspectFit" :src='STATIC_URL+"151.png"'></image>
            <view class='flex flex-direction align-stretch flex-sub customers_fd3_0_c1'>
              <view class='flex flex-wrap align-center customers_fd3_0_c1'>
                <text>{{item.customer_name}}</text>
                <!-- <image class='customers_fd3_0_c1_c0_c1' mode="aspectFit" :src='STATIC_URL+"155.png"'></image> -->
              </view>
              <view class='flex flex-wrap align-center customers_fd3_0_c1_c1'>
                <text>{{item.customer_phone}}</text>
              </view>
            </view>
            <image class='customers_fd3_0_c2' mode="aspectFit" :src='STATIC_URL+"154.png"' @tap.stop="handleJumpDiy"
              data-type="navigateTo" :data-url="`/pages/grzx/custr/custr?aid=${item.aid}`"></image>
          </view>
          <view class='flex flex-wrap align-end customers_fd3_1'>
            <text class='customers_fd3_1_c0'>{{item.customer_type_name}}日期：</text>
            <text>{{item.date_time}}</text>
          </view>
        </view>
      </template>
      <fu-empty :pagingListLoadedAll="pagingListLoadedAll" :pagingListNoListData="pagingListNoListData"
        :listDataLength="listDataLength" :isLoadInit="isLoadInit"></fu-empty>
      <!---flex布局flex布局结束-->
      <view class="flex flex-wrap align-center justify-center benben-position-layout flex customers_flex_4"
        @tap.stop="handleJumpDiy" data-type="navigateTo" :data-url="`/pages/grzx/newCustomer/newCustomer`">
        <text class='self-center'>新建
          客户</text>

      </view>
      <view :style="{height: '128rpx'}"></view>


    </view>
  </page-body>
</template>
<script>
  import pagingList from '@/common/mixin/paging_list.js';
  export default {
    components: {},
    mixins: [pagingList],

    data() {
      return {
        "minixPagingListsApi": "",
        "pageingListApiMethod": "",
        "allowOnloadGetList": false,
        "cateId": "1",
        "dataList": [],
        "keywords": "",
        "cid": "",
        total: 0
      };
    },
    computed: {

    },
    watch: {},
    onLoad(options) {
      // this.getData()

    },
    onUnload() {

    },
    onReady() {

    },
    onShow() {
      this.getListFunc()
    },
    onHide() {

    },
    onResize() {

    },
    onPullDownRefresh() {

    },
    onReachBottom(e) {

    },
    onPageScroll(e) {

    },
    methods: {
      getData() {
        this.$api.post(global.apiUrls.post666cefa6c20b2, {
          keywords: this.keywords
        }).then(res => {
          if (res.data.code == 1) {
            this.total = res.data.data.total
          }
        })
      },
      getListFunc() {
        this.getData()
        this.minixPagingListsApi = global.apiUrls.post666cefa6c20b2;
        this.pageingListApiMethod = 'post';
        this.allowOnloadGetList = false;
        this.pagingListPostDataContent = {
          keywords: this.keywords
        }
        this.listData = [];
        this.dataList = this.listData;
        this.pagingListToggle();

      },
      pagingListPostData() {
        return this.pagingListPostDataContent
      },

    }
  };
</script>
<style lang="scss" scoped>
  .page {
    width: 100vw;
    overflow-x: hidden;
    min-height: calc(100vh - var(--window-bottom));
    background: #F8F8F8;
    background-size: 100% auto;
  }

  .customers_flex_0 {
    border-bottom: 1px solid #eee;
    background: #fff;
    width: 750rpx;
    height: 88rpx;
    overflow: hidden;
    z-index: 10;
    top: 0rpx;
    background-size: 100% auto !important;
  }

  .customers_fd0_0_c1_c0 {
    font-size: 36rpx;
    font-weight: 700;
    color: #333333;
    line-height: 50rpx;
  }

  .customers_fd0_0_c0_c0 {
    font-size: 36rpx;
    color: #333;
  }

  .customers_fd0_0_c0 {
    width: 120rpx;
  }

  .customers_fd0_0 {
    padding: 0rpx 32rpx 0rpx 32rpx;
  }

  .customers_flex_1 {
    background: var(--benbenbgColor1);
    padding: 24rpx;
    background-size: 100% 100%;
  }

  .input-box {
    height: 70rpx;
    line-height: 70rpx;
    font-size: 26rpx;
    width: 90%;
  }

  .customers_fd1_0_c0 {
    width: 24rpx;
    height: 24rpx;
    margin: 0rpx 16rpx 0rpx 0rpx;
  }

  .customers_fd1_0 {
    background: #F8F8F8;
    border-radius: 34rpx;
    width: 686rpx;
    height: 64rpx;
    line-height: 64rpx;
    padding: 0rpx 24rpx 0rpx 24rpx;
  }

  .customers_flex_2 {
    width: 686rpx;
    margin: 37rpx auto 26rpx auto;
  }

  .customers_fd2_2 {
    font-size: 34rpx;
    font-weight: 600;
    transform: translateY(3rpx);
  }

  .customers_fd2_1 {
    margin: 0rpx 16rpx 0rpx 8rpx;
  }

  .customers_fd2_0 {
    background: url(image-path('159.png')) no-repeat;
    width: 14rpx;
    height: 28rpx;
    background-size: 100% 100% !important;
    margin: 0rpx 10rpx 0rpx 10rpx;
    transform: scaleX(0.5);
  }

  .customers_flex_3 {
    background: rgba(255, 255, 255, 1);
    margin: 26rpx 24rpx 0rpx 24rpx;
    padding: 24rpx 24rpx 0rpx 24rpx;
    border-radius: 26rpx;
    background-size: 100% auto;
  }

  .customers_fd3_1_c0 {
    color: rgba(170, 170, 170, 1);
  }

  .customers_fd3_1 {
    padding: 24rpx 0rpx 24rpx 0rpx;
    font-size: 32rpx;
  }

  .customers_fd3_0_c2 {
    width: 42rpx;
    height: 42rpx;
  }

  .customers_fd3_0_c1_c1 {
    margin: 16rpx 0rpx 0rpx 0rpx;
  }

  .customers_fd3_0_c1_c0_c1 {
    width: 115rpx;
    height: 34rpx;
    margin: 0rpx 0rpx 0rpx 16rpx;
  }

  .customers_fd3_0_c1 {
    font-size: 32rpx;
    font-weight: 600;
  }

  .customers_fd3_0_c0 {
    width: 62rpx;
    height: 67rpx;
    margin: 0rpx 24rpx 0rpx 0rpx;
  }

  .customers_fd3_0 {
    border-bottom: 1px solid #eee;
    padding: 0rpx 0rpx 24rpx 0rpx;
  }

  .customers_flex_4 {
    background: #FFFFFF;
    width: 128rpx;
    height: 128rpx;
    overflow: hidden;
    z-index: 10;
    box-shadow: 0rpx 3rpx 15rpx 1rpx rgba(223, 188, 134, 0.51);
    bottom: calc(100rpx + var(--window-bottom));
    right: 32rpx;
    border-radius: 100rpx;
  }
</style>
